<!DOCTYPE html>
{% load static %}
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{% block title %}webKeepass{% endblock %}</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="{% static 'bootstrap/css/bootstrap.min.css' %}">
    <link rel="stylesheet" href="{% static 'plugins/font-awesome-4.6.3/css/font-awesome.min.css' %}">
    <link rel="stylesheet" href="{% static 'plugins/ionicons-2.0.1/css/ionicons.min.css' %}">
    <!-- Theme style -->
    <link rel="stylesheet" href="{% static 'plugins/datatables/dataTables.bootstrap.css' %}">
    <link rel="stylesheet" href="{% static 'dist/css/AdminLTE.min.css' %}">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="{% static 'dist/css/skins/_all-skins.min.css' %}">
    {% block css %} {% endblock %}
</head>
<body class="hold-transition skin-blue-light sidebar-mini">
<div class="wrapper">
    <header class="main-header">

        <!-- Logo -->
        <a href="#" class="logo">
            <!-- mini logo for sidebar mini 50x50 pixels -->
            <span class="logo-mini"><b>KP</b></span>
            <!-- logo for regular state and mobile devices -->
            <span class="logo-lg"><b>web&nbsp;Keepass</b></span>
        </a>

        <!-- Header Navbar: style can be found in header.less -->
        <nav class="navbar navbar-static-top">
            <!-- Sidebar toggle button-->
            <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
            <span class="sr-only">Toggle navigation</span>
            </a>

            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <!-- User Account: style can be found in dropdown.less -->
                    <li class="user user-menu">
                        <a href="#">
                            <img src="{% static 'dist/img/user1-128x128.jpg' %}" class="user-image" alt="User Image">
                            <span class="hidden-xs">{{ request.user }}</span>
                        </a>
                    </li>
                    <li>
                        <a href="/logout/" >登出</a>
                    </li>
                </ul>
            </div>
        </nav>
    </header>

  <!-- Left side column. contains the logo and sidebar -->
  <aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
      <!-- Sidebar user panel -->
      <div class="user-panel">
        <div class="pull-left image">
          <img src="{% static 'dist/img/user1-128x128.jpg' %}" class="img-circle" alt="User Image">
        </div>
        <div class="pull-left info">
          <p>{{ request.user }}</p>
          <a href="#"><i class="fa fa-circle text-success"></i>Online</a>
        </div>
      </div>

        <ul class="sidebar-menu">
                <li class="header">导航栏</li>
                <li class="treeview">
                    <a href="/group/">
                        <i class="fa fa-laptop"></i> <span>密码组</span>
                        <span class="pull-right-container">
                            <i class="fa fa-angle-left pull-right"></i>
                        </span>
                    </a>
                </li>
                <li class="treeview">
                    <a href="/item/list/">
                        <i class="fa fa-paste"></i> <span>密码</span>
                        <span class="pull-right-container">
                            <i class="fa fa-angle-left pull-right"></i>
                        </span>
                    </a>
                </li>
                {% if request.user.is_superuser %}
                <li class="treeview" hidden="">
                    <a href="/log/">
                        <i class="fa fa-file-text"></i> <span>日志系统</span>
                        <span class="pull-right-container">
                            <i class="fa fa-angle-left pull-right"></i>
                        </span>
                    </a>
                </li>
                {% endif %}
            </ul>

      <!-- sidebar menu: : style can be found in sidebar.less -->
    </section>
    <!-- /.sidebar -->
  </aside>
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
    {% block content %}
      <!-- Main content -->
    <section class="content"></section>
      <!-- /.content -->

    {% endblock %}
    </div>
    <!-- /.content-wrapper -->

    <footer class="main-footer">
        <div class="pull-right hidden-xs">
            <b>Version</b> 1.0.0
        </div>
        <strong>Copyright &copy; {% now  'Y' %}- <a href="https://www.cnblogs.com/richardzgt">webKeepass</a>.</strong> All rights reserved.
    </footer>


</div>
<!-- ./wrapper -->

<!-- jQuery 2.2.3 -->
<script src="{%  static 'plugins/jQuery/jquery-2.2.3.min.js' %}" ></script>

<script src="{% static 'plugins/jQueryUI/jquery-ui.min.js' %}"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
    $.widget.bridge('uibutton', $.ui.button);
</script>
<!-- Bootstrap 3.3.6 -->
<script src="{%  static 'dist/js/app.min.js' %}"></script>

<script src="{%  static 'bootstrap/js/bootstrap.min.js' %}" ></script>

<script>
    $(document).ready(function () {
        $('ul.sidebar-menu').find('a').each(function () {
            if(this.href == document.location.href || document.location.href.search(this.href) >=0 ){
                $(this).parent().addClass('active');
            }
        });
    });

    function delConfirm() {
        if (confirm("确定删除？")){
            return true;
        } else {
            return false;
        }
    }

</script>
{% block script %}{% endblock %}


</body>
</html>
